<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/violation/violation.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/violation/violation.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ViolationId',
                footer: "Foots",
                cnName: '违章记录',
                name: 'violation/violation',
                url: "/VehicleService/api/violation/",
                sortName: "CreateTime"
            });
            const editFormFields = ref({"ViolationTitle":"","CarLicense":"","ViolationPerSon":"","ViolationDate":"","ViolationContent":"","ViolationResult":"","ViolationRemark":""});
            const editFormOptions = ref([[{"title":"违章标题","field":"ViolationTitle"}],
                              [{"dataKey":"车牌号下拉框","data":[],"title":"车牌号","field":"CarLicense","type":"select"}],
                              [{"title":"违章人","field":"ViolationPerSon"}],
                              [{"title":"违章日期","field":"ViolationDate","type":"datetime"}],
                              [{"title":"违章内容","field":"ViolationContent"}],
                              [{"title":"处罚结果","field":"ViolationResult"}],
                              [{"title":"备注","field":"ViolationRemark"}]]);
            const searchFormFields = ref({"ViolationTitle":"","CarLicense":"","ViolationDate":""});
            const searchFormOptions = ref([[{"title":"违章标题","field":"ViolationTitle","type":"text"},{"dataKey":"车牌号下拉框","data":[],"title":"车牌号","field":"CarLicense","type":"select"},{"title":"违章日期","field":"ViolationDate","type":"datetime"}]]);
            const columns = ref([{field:'ViolationId',title:'违章记录Id',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ViolationTitle',title:'违章标题',type:'string',width:110,align:'left',sort:true},
                       {field:'CarLicense',title:'车牌号',type:'string',bind:{ key:'车牌号下拉框',data:[]},width:110,align:'left'},
                       {field:'ViolationPerSon',title:'违章人',type:'string',width:110,align:'left'},
                       {field:'ViolationDate',title:'违章日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ViolationContent',title:'违章内容',type:'string',width:110,align:'left'},
                       {field:'ViolationResult',title:'处罚结果',type:'string',width:110,align:'left'},
                       {field:'ViolationRemark',title:'备注',type:'string',width:110,align:'left'},
                       {field:'IsDelete',title:'逻辑删除',type:'int',width:110,hidden:true,align:'left'},
                       {field:'CreateName',title:'创建人',type:'string',width:110,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',sort:true,width:150,align:'left',sort:true},
                       {field:'UpdateName',title:'修改人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'UpdateTime',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
